package com.isunland.managesystem.ui;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import com.isunland.managesystem.entity.LeaseSubList;

/**
 * 开发公司: 北京信普达系统工程有限公司
 * 开发人员: wangyanan
 */

public class LeaseEquipmentDetailActivity extends SingleFragmentActivity {

  private LeaseSubList item;
  private String status;

  public static void newInstance(android.support.v4.app.Fragment fragment, Activity context,
      LeaseSubList item, String status, int requestCode) {
    if (fragment == null || context == null) return;
    Intent i = new Intent(context, LeaseEquipmentDetailActivity.class);
    i.putExtra(LeaseEquipmentDetailFragment.EXTRA_ITEM, item);
    i.putExtra(LeaseEquipmentDetailFragment.EXTRA_STATUS, status);
    fragment.startActivityForResult(i, requestCode);
  }

  @Override protected void onCreate(Bundle arg0) {
    item = (LeaseSubList) getIntent().getSerializableExtra(LeaseEquipmentDetailFragment.EXTRA_ITEM);
    status = getIntent().getStringExtra(LeaseEquipmentDetailFragment.EXTRA_STATUS);
    super.onCreate(arg0);
  }

  @Override protected Fragment createFragment() {
    return LeaseEquipmentDetailFragment.newInstance(item, status);
  }
}
